home *** CD-ROM | disk | FTP | other *** search
/ Stargate SG-1 Cardz / Stargate SG-1 CD Cardz Teal'c.bin / mac / assets / teal.dxr / 00005_Script_5 < prev    next >
Text File  |  2001-11-23  |  5KB  |  102 lines

  1. --DirectMedia Xtra Controller Button   
  2.  
  3. property videoSprite    -- the sprite number that is getting controlled
  4. property videoCommand   -- the command to be issued
  5. property standardImage  -- the Button Image
  6. property alternateImage -- the Rollover Image for the button
  7. property clickedImage   -- the Clicked Image for the button rollover and click.
  8. property param1  -- first parameter of the command
  9. property param2  -- second parameter of the command
  10.  
  11. property pMac -- added stuart
  12.  
  13. on DoControl me
  14.   case ( the VideoCommand of me ) of:
  15.     #Play:
  16.       if pMac then sprite(videoSprite).movieRate = 1
  17.       else videoplay(sprite the videoSprite of me)
  18.       
  19.     #Pause:
  20.       if pMac then sprite(videoSprite).movieRate = 0
  21.       else videopause(sprite the videoSprite of me)
  22.     #Rewind:
  23.       if pMac then 
  24.         sprite(videoSprite).movieTime = 0
  25.         sprite(videoSprite).movieRate = 1
  26.       else 
  27.         videoseek(sprite the videoSprite of me, the segmentstart of sprite the videoSprite of me)
  28.       end if
  29.       
  30.     #StepForward:
  31.       if pMac then 
  32.         sprite(videoSprite).movieRate = 2
  33.       else 
  34.         
  35.         videopause(sprite the videoSprite of me)
  36.         videoseek(sprite the videoSprite of me, the currenttime of sprite the videoSprite of me+30)
  37.       end if
  38.       
  39.     #StepBackward:
  40.       if pMac then 
  41.         sprite(videoSprite).movieRate = -2
  42.       else 
  43.         
  44.         videopause(sprite the videoSprite of me)
  45.         videoseek(sprite the videoSprite of me, the currenttime of sprite the videoSprite of me-30)
  46.       end if
  47.       
  48.     #Seek:
  49.       videoseek(sprite the videoSprite of me, the param1 of me)
  50.     #PlaySegment:
  51.       videoplaysegment(sprite the videoSprite of me, the param1 of me, the param2 of me)
  52.       
  53.   end case
  54. end
  55.  
  56.  
  57. on mouseUp me
  58.   set the member of sprite the spritenum of me = the standardImage of me
  59.   DoControl me
  60. end
  61.  
  62. on mouseDown me
  63.   set the member of sprite the spritenum of me = the clickedImage of me
  64. end  
  65.  
  66. on mouseEnter me
  67.   set the member of sprite the spritenum of me = the alternateImage of me
  68. end  
  69.  
  70. on mouseLeave me
  71.   set the member of sprite the spritenum of me = the standardImage of me
  72. end
  73.  
  74. ---
  75.  
  76. on beginSprite me
  77.   if the platform contains "mac" then pMac = 1
  78.   else pMac = 0
  79.   
  80.   set the standardImage of me = the member of sprite the spriteNum of me
  81. end
  82.  
  83. ---
  84.  
  85. on getPropertyDescriptionList
  86.   if the currentspritenum = 0 then 
  87.     set memdefault = 0 
  88.   else
  89.     set memref = the member of sprite the currentspritenum
  90.     set memdefault = member (the membernum of member memref + 1) 
  91.     set memdefault2 = member (the membernum of member memref + 2) 
  92.   end if
  93.   
  94.   set p_list = [   #videoCommand: [ #comment:   "Action:",#format:   #symbol,   #range: [ #Play, #Pause, #Rewind,#StepBackward,#StepForward, #Seek, #PlaySegment],#default:   #Play ], #param1: [ #comment:   "First Parameter (Use with seek or playsegment):", #format:   #long, #default:    0] , #param2: [ #comment:   "Second Parameter (Use with playsegment):", #format: #long,   #default:    0] ,  #videoSprite: [ #comment:   "DirectMedia Sprite Channel:", #format:   #integer,   #default:    1] ,    #alternateImage: [ #comment:   "Rollover Button Cast Member:",                     #format:   #graphic,                    #default:    memdefault ], #clickedImage: [ #comment:   "Clicked Button Cast Member:",                     #format:   #graphic,                    #default:    memdefault2 ]]                  
  95.   return p_list
  96. end
  97.  
  98. on getBehaviorDescription
  99.   return "Used to create Play, Pause, StepForward, StepBackward, Rewind, Seek and PlaySegment control buttons for a DirectMedia Xtra video sprite. You can also attach rollover and alternate images for the clicked buttons" & RETURN & "PARAMETERS:" & RETURN & "Action - Choose the action to perform on mouseUP ( Play, Pause, Rewind, StepBackward, StepForward, Seek, PlaySegment )." & RETURN & "First Parameter: if the Action is Seek than this parameter contains the seek to time (in milliseconds). For the PlaySegment action this parameter contains the starting time of the segment to play (in milliseconds)"& RETURN &"Second Parameter: Used with the PlaySegment action. Contains the ending time of the segment to play (in milliseconds)"& RETURN &"DirectMedia Sprite Channel - Enter the number of sprite channel of the DirectMedia Xtra video that is being controlled."& RETURN &"Rollover Button: the castmember that will be used as the rollover image of the button. Default is the castmember located just after the button castmember"& RETURN&"Clicked Button: the castmember that will be used as the clicked image of the button. Default is the castmember located just after the rollover castmember"
  100. end
  101.  
  102.